package com.hqyj.hrms.modules.account.controller;


import com.hqyj.hrms.modules.account.entity.Power;
import com.hqyj.hrms.modules.account.entity.Role;
import com.hqyj.hrms.modules.account.service.PowerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;


@RestController
@RequestMapping("/power")
public class PowerController {

    @Autowired
    PowerService powerService;

    //查询权限
//   @GetMapping("/selectPower")
//    public HashMap<String, Object> selectPower(String userName) {
//        return powerService.selectPower(userName);
//    }

    //新增
    @GetMapping("/add")
    public HashMap<String, Object> add(Power power) {
        return powerService.add(power);
    }

    //修改
    @GetMapping("/update")
    public HashMap<String, Object> update(Power power) {
        return powerService.update(power);
    }

    //删除
    @GetMapping("/del")
    public HashMap<String, Object> del(Integer id) {
        return powerService.del(id);
    }

    //查询
    @GetMapping("/list")
    public HashMap<String, Object> list(Power power) {
        return powerService.list(power);
    }
}

